package cn.smbms.dao;

import cn.smbms.pojo.User;
import cn.smbms.utils.PageSupport;
import org.apache.ibatis.annotations.Param;

import java.util.List;


public interface UserMapper {

    //登录
    User Login(@Param("userCode") String userCode, @Param("userPassword") String password);

    //根据userCode查询User
    User  getUserByUserCode(@Param("userCode")String userCode);

    User getUserById(@Param("id") Integer id);

    //查询总数
    Integer getUserCount(@Param("userName")String userName, @Param("userRole") Integer userRole);

    //查询
    List<User> getUserList(@Param("userName")String userName, @Param("userRole")Integer userRole, @Param("pageSupport") PageSupport pageSupport);

    //添加
    Boolean addUser(@Param("user") User user);

    Boolean deleteUser(@Param("id") Integer userid);

    Boolean updateUser(@Param("user") User user);

    Boolean updateUserPassword(@Param("id") Integer id,@Param("userPassword") String userPassword);
}
